#  Copyright (c) 2020 - ~, WANGXI
#  
#  GRAMMA ARRAY TEST TCL FILE
#  Used in NS-2 simulator
#  Clone from https://gitee.com/WangXi_Chn/ns2_modulelib
#  Note in https://www.yuque.com/wangxi_chn/kozrfl
#  
#  Change Logs:
#  Date           Author       Notes			Mail
#  2020-12-05     WangXi   	   first version	WangXi_Chn@foxmail.com

set myarray(0) "Zero"
set myarray(1) "One"
set myarray(2) "Two"

for {set i 0} {$i < 3} {incr i 1} {
    puts $myarray($i)
}

#---------------------------
set person_info(name) "Fred Smith"
set person_info(age) "25"
set person_info(occupation) "Plumber"
foreach thing {name age occupation} {
    puts "$thing == $person_info($thing)"
}

#---------------------------
set person_info(name) "Fred Smith"
set person_info(age) "25"
set person_info(occupation) "Plumber"
# instead of listing all the element of Array 
foreach thing [array names person_info] {
    puts "$thing == $person_info($thing)"
}












#/************************ (C) COPYRIGHT 2020 WANGXI **************END OF FILE****/
